delete_transient_{$transient}
Action HookDescription
Fires immediately before a specific transient is deleted. The dynamic portion of the hook name, `$transient`, refers to the transient name.Hook Information
File Location |
wp-includes/option.php
View on GitHub
|
Hook Type | Action |
Line Number | 1391 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$transient
|
Transient name. |
Usage Examples
Basic Usage
<?php
// Hook into delete_transient_{$transient}
add_action('delete_transient_{$transient}', 'my_custom_function', 10, 1);
function my_custom_function($transient) {
// Your custom code here
}
Source Code Context
wp-includes/option.php:1391
- How this hook is used in WordPress core
<?php
1386 *
1387 * @since 3.0.0
1388 *
1389 * @param string $transient Transient name.
1390 */
1391 do_action( "delete_transient_{$transient}", $transient );
1392
1393 if ( wp_using_ext_object_cache() || wp_installing() ) {
1394 $result = wp_cache_delete( $transient, 'transient' );
1395 } else {
1396 $option_timeout = '_transient_timeout_' . $transient;
PHP Documentation
<?php
/**
* Fires immediately before a specific transient is deleted.
*
* The dynamic portion of the hook name, `$transient`, refers to the transient name.
*
* @since 3.0.0
*
* @param string $transient Transient name.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/option.php
Related Hooks
Related hooks will be displayed here in future updates.